import Vue from 'vue'
import Vuex from 'vuex';
import user from './modules/user';
import issue from './modules/issue';
import bidding from './modules/bidding';
import caseManage from './modules/case';
import caseExample from './modules/caseExample';
import law from './modules/law';
import lawyer from './modules/lawyer';
import publicWelfare from './modules/publicWelfare';
import notice from './modules/notice';
import banner from './modules/banner';
import consult from './modules/consult';
import transaction from './modules/transaction';
import team from './modules/team';
import staff from './modules/staff';
import permission from './modules/permission';
import common from './modules/common';
import withdraw from './modules/withdraw';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    token: null,
    count: 0,
    provinceList: null
  },
  mutations: {
    setProvinceList(state, list) {
      state.provinceList = list;
    },
    getProvinceList(state) {
      return state.provinceList;
    },
    setToken(state, token) {
      state.token = token;
    },
    increment (state) {
      state.count++
    }
  },
  actions: {

  },
  modules: {
    user,
    issue,
    bidding,
    caseManage,
    caseExample,
    law,
    lawyer,
    publicWelfare,
    notice,
    banner,
    consult,
    transaction,
    team,
    staff,
    permission,
    common,
    withdraw
  }
});